case GTK_IMAGE_GICON:
{
GtkIconSize size;
- GtkSettings *settings;
-
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
g_object_get (gtk_image, "icon-size", &size, NULL);
- gtk_icon_size_lookup_for_settings (settings, size, width, height);
+ gtk_icon_size_lookup (size, width, height);
break;
}
case GTK_IMAGE_ANIMATION:
if (entries[i].stock_id)
{
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
if (gtk_icon_factory_lookup_default (entries[i].stock_id))
g_object_set (action, "stock-id", entries[i].stock_id, NULL);
else
g_object_set (action, "icon-name", entries[i].stock_id, NULL);
+
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
gtk_toggle_action_set_active (action, entries[i].is_active);
if (entries[i].stock_id)
{
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
if (gtk_icon_factory_lookup_default (entries[i].stock_id))
g_object_set (action, "stock-id", entries[i].stock_id, NULL);
else
g_object_set (action, "icon-name", entries[i].stock_id, NULL);
+
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
if (i == 0)
GtkWidget *widget)
{
GtkCellRendererSpinnerPrivate *priv = cell->priv;
- GdkScreen *screen;
- GtkSettings *settings;
if (priv->old_icon_size == priv->icon_size)
return;
- screen = gtk_widget_get_screen (GTK_WIDGET (widget));
- settings = gtk_settings_get_for_screen (screen);
-
- if (!gtk_icon_size_lookup_for_settings (settings, priv->icon_size, &priv->size, NULL))
+ if (!gtk_icon_size_lookup (priv->icon_size, &priv->size, NULL))
{
g_warning ("Invalid icon size %u\n", priv->icon_size);
priv->size = 24;
change_icon_theme (GtkFileChooserButton *button)
{
GtkFileChooserButtonPrivate *priv = button->priv;
- GtkSettings *settings;
GtkIconTheme *theme;
GtkTreeIter iter;
GSList *l;
g_slist_free (button->priv->change_icon_theme_cancellables);
button->priv->change_icon_theme_cancellables = NULL;
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (button)));
-
- if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
- &width, &height))
+ if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
priv->icon_size = MAX (width, height);
else
priv->icon_size = FALLBACK_ICON_SIZE;
change_icon_theme (GtkFileChooserDefault *impl)
{
GtkFileChooserDefaultPrivate *priv = impl->priv;
- GtkSettings *settings;
gint width, height;
profile_start ("start", NULL);
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (impl)));
-
- if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height))
+ if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
priv->icon_size = MAX (width, height);
else
priv->icon_size = FALLBACK_ICON_SIZE;
#include "config.h"
+#define GDK_DISABLE_DEPRECATION_WARNINGS
+
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "gtktypebuiltins.h"
#include "deprecated/gtkstyle.h"
-
/**
* SECTION:gtkiconfactory
* @Short_description: Manipulating stock icons
* themes to override the icons for the application.
*
* Return value: a new #GtkIconFactory
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconFactory*
gtk_icon_factory_new (void)
* override your application's default icons. If an icon already
* existed in @factory for @stock_id, it is unreferenced and replaced
* with the new @icon_set.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_factory_add (GtkIconFactory *factory,
* function directly, so that themes are taken into account.
*
* Return value: (transfer none): icon set of @stock_id.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet *
gtk_icon_factory_lookup (GtkIconFactory *factory,
* There will normally be an icon factory added for each library or
* application that comes with icons. The default icon factories
* can be overridden by themes.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_factory_add_default (GtkIconFactory *factory)
* Removes an icon factory from the list of default icon
* factories. Not normally used; you might use it for a library that
* can be unloaded or shut down.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_factory_remove_default (GtkIconFactory *factory)
* account.
*
* Return value: (transfer none): a #GtkIconSet, or %NULL
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet *
gtk_icon_factory_lookup_default (const gchar *stock_id)
* etc. Returns the integer value for the size.
*
* Returns: (type int): integer value representing the size
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSize
gtk_icon_size_register (const gchar *name,
* Registers @alias as another name for @target.
* So calling gtk_icon_size_from_name() with @alias as argument
* will return @target.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_size_register_alias (const gchar *alias,
* Looks up the icon size associated with @name.
*
* Return value: (type int): the icon size
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSize
gtk_icon_size_from_name (const gchar *name)
* is statically allocated and should not be freed.
*
* Returns: the name of the given icon size.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
const gchar*
gtk_icon_size_get_name (GtkIconSize size)
* a #GtkIconFactory.
*
* Return value: a new #GtkIconSet
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet*
gtk_icon_set_new (void)
* or make the icon look insensitive/prelighted.
*
* Return value: a new #GtkIconSet
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet *
gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf)
* Increments the reference count on @icon_set.
*
* Return value: @icon_set.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSet*
gtk_icon_set_ref (GtkIconSet *icon_set)
*
* Decrements the reference count on @icon_set, and frees memory
* if the reference count reaches 0.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_set_unref (GtkIconSet *icon_set)
* Copies @icon_set by value.
*
* Return value: a new #GtkIconSet identical to the first.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
**/
GtkIconSet*
gtk_icon_set_copy (GtkIconSet *icon_set)
* Return value: (transfer full): a #GdkPixbuf to be displayed
*
* Since: 3.0
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GdkPixbuf *
gtk_icon_set_render_icon_pixbuf (GtkIconSet *icon_set,
*
* gtk_icon_set_new_from_pixbuf() creates a new icon set with a
* default icon source based on the given pixbuf.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_set_add_source (GtkIconSet *icon_set,
*
* Obtains a list of icon sizes this icon set can render. The returned
* array must be freed with g_free().
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_set_get_sizes (GtkIconSet *icon_set,
* direction, widget state, or icon size.
*
* Return value: a new #GtkIconSource
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSource*
gtk_icon_source_new (void)
* Creates a copy of @source; mostly useful for language bindings.
*
* Return value: a new #GtkIconSource
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSource*
gtk_icon_source_copy (const GtkIconSource *source)
*
* Frees a dynamically-allocated icon source, along with its
* filename, size, and pixbuf fields if those are not %NULL.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_free (GtkIconSource *source)
*
* Sets the name of an image file to use as a base image when creating
* icon variants for #GtkIconSet. The filename must be absolute.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_filename (GtkIconSource *source,
*
* Sets the name of an icon to look up in the current icon theme
* to use as a base image when creating icon variants for #GtkIconSet.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_icon_name (GtkIconSource *source,
*
* Sets a pixbuf to use as a base image when creating icon variants
* for #GtkIconSet.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_pixbuf (GtkIconSource *source,
*
* Return value: (type filename): image filename. This string must not
* be modified or freed.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
const gchar*
gtk_icon_source_get_filename (const GtkIconSource *source)
* persist beyond the lifetime of the icon source.
*
* Return value: icon name. This string must not be modified or freed.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
const gchar*
gtk_icon_source_get_icon_name (const GtkIconSource *source)
* not incremented.
*
* Return value: (transfer none): source pixbuf
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GdkPixbuf*
gtk_icon_source_get_pixbuf (const GtkIconSource *source)
*
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
* wildcarded sources, and will use an exact match when possible.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
* produce an appropriate icon for a given state, for example
* lightening an image on prelight, but will not modify source images
* that match exactly.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
* #GtkIconSet will normally scale wildcarded source images to produce
* an appropriate icon at a given size, but will not change the size
* of source images that match exactly.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
* Gets the value set by gtk_icon_source_set_size_wildcarded().
*
* Return value: %TRUE if this icon source is a base for any icon size variant
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
gboolean
gtk_icon_source_get_size_wildcarded (const GtkIconSource *source)
* Gets the value set by gtk_icon_source_set_state_wildcarded().
*
* Return value: %TRUE if this icon source is a base for any widget state variant
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
gboolean
gtk_icon_source_get_state_wildcarded (const GtkIconSource *source)
* Gets the value set by gtk_icon_source_set_direction_wildcarded().
*
* Return value: %TRUE if this icon source is a base for any text direction variant
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
gboolean
gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source)
* if the text direction is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
* in addition to calling this function.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_direction (GtkIconSource *source,
* if the state is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_state_wildcarded() to un-wildcard it
* in addition to calling this function.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_state (GtkIconSource *source,
* if the size is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_size_wildcarded() to un-wildcard it
* in addition to calling this function.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
void
gtk_icon_source_set_size (GtkIconSource *source,
* wildcarded.
*
* Return value: text direction this source matches
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkTextDirection
gtk_icon_source_get_direction (const GtkIconSource *source)
* wildcarded.
*
* Return value: widget state this source matches
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkStateType
gtk_icon_source_get_state (const GtkIconSource *source)
* is only useful/meaningful if the icon size is <emphasis>not</emphasis> wildcarded.
*
* Return value: (type int): icon size this source matches.
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GtkIconSize
gtk_icon_source_get_size (const GtkIconSource *source)
* The list itself should be freed.
*
* Return value: List of ids in icon factories
+ *
+ * Deprecated: 3.10: Use #GtkIconTheme instead.
*/
GList*
_gtk_icon_factory_list_ids (void)
void (*_gtk_reserved4) (void);
};
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GType gtk_icon_factory_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconFactory* gtk_icon_factory_new (void);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_factory_add (GtkIconFactory *factory,
const gchar *stock_id,
GtkIconSet *icon_set);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_factory_lookup (GtkIconFactory *factory,
const gchar *stock_id);
/* Manage the default icon factory stack */
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_factory_add_default (GtkIconFactory *factory);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_factory_remove_default (GtkIconFactory *factory);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_factory_lookup_default (const gchar *stock_id);
/* Get preferred real size from registered semantic size. Note that
gint *width,
gint *height);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSize gtk_icon_size_register (const gchar *name,
gint width,
gint height);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_size_register_alias (const gchar *alias,
GtkIconSize target);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSize gtk_icon_size_from_name (const gchar *name);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
const gchar* gtk_icon_size_get_name (GtkIconSize size);
/* Icon sets */
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GType gtk_icon_set_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_new (void);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_new_from_pixbuf (GdkPixbuf *pixbuf);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_ref (GtkIconSet *icon_set);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_set_unref (GtkIconSet *icon_set);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSet* gtk_icon_set_copy (GtkIconSet *icon_set);
GDK_DEPRECATED_IN_3_0_FOR(gtk_icon_set_render_icon_pixbuf)
GtkWidget *widget,
const gchar *detail);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_set_add_source (GtkIconSet *icon_set,
const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_set_get_sizes (GtkIconSet *icon_set,
GtkIconSize **sizes,
gint *n_sizes);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GType gtk_icon_source_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSource* gtk_icon_source_new (void);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSource* gtk_icon_source_copy (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_free (GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_filename (GtkIconSource *source,
const gchar *filename);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_icon_name (GtkIconSource *source,
const gchar *icon_name);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_pixbuf (GtkIconSource *source,
GdkPixbuf *pixbuf);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
const gchar * gtk_icon_source_get_filename (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
const gchar * gtk_icon_source_get_icon_name (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GdkPixbuf* gtk_icon_source_get_pixbuf (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_direction_wildcarded (GtkIconSource *source,
gboolean setting);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_state_wildcarded (GtkIconSource *source,
gboolean setting);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_size_wildcarded (GtkIconSource *source,
gboolean setting);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
gboolean gtk_icon_source_get_size_wildcarded (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
gboolean gtk_icon_source_get_state_wildcarded (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
gboolean gtk_icon_source_get_direction_wildcarded (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_direction (GtkIconSource *source,
GtkTextDirection direction);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_state (GtkIconSource *source,
GtkStateType state);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
void gtk_icon_source_set_size (GtkIconSource *source,
GtkIconSize size);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkTextDirection gtk_icon_source_get_direction (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkStateType gtk_icon_source_get_state (const GtkIconSource *source);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10
GtkIconSize gtk_icon_source_get_size (const GtkIconSource *source);
if (self->priv->icon_set != NULL)
{
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_icon_set_unref (self->priv->icon_set);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
self->priv->icon_set = NULL;
}
gint *height_out)
{
gint width, height;
- GtkSettings *settings;
- GdkScreen *screen;
-
- screen = gtk_style_context_get_screen (context);
- settings = gtk_settings_get_for_screen (screen);
if (self->priv->pixel_size != -1)
{
width = height = self->priv->pixel_size;
}
- else if (!gtk_icon_size_lookup_for_settings (settings,
- self->priv->icon_size,
- &width, &height))
+ else if (!gtk_icon_size_lookup (self->priv->icon_size, &width, &height))
{
if (self->priv->icon_size == GTK_ICON_SIZE_INVALID)
{
GtkIconSource *source;
GdkPixbuf *rendered;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
+ /* FIXME: use gtk_icon_info_load_icon? */
+
source = gtk_icon_source_new ();
gtk_icon_source_set_pixbuf (source, destination);
/* The size here is arbitrary; since size isn't
rendered = gtk_render_icon_pixbuf (context, source, (GtkIconSize) -1);
gtk_icon_source_free (source);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
g_object_unref (destination);
destination = rendered;
}
if (!check_invalidate_pixbuf (self, context))
return;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
self->priv->rendered_pixbuf =
gtk_icon_set_render_icon_pixbuf (icon_set, context, self->priv->icon_size);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
static void
break;
case GTK_IMAGE_STOCK:
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
icon_set = gtk_style_context_lookup_icon_set (context, self->priv->stock_id);
if (icon_set != NULL)
ensure_pixbuf_for_icon_set (self, context, icon_set);
else
pixbuf = NULL;
+ G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case GTK_IMAGE_ICON_SET:
if (icon_set != NULL)
{
self->priv->storage_type = GTK_IMAGE_ICON_SET;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
self->priv->icon_set = gtk_icon_set_ref (icon_set);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
_gtk_icon_helper_set_icon_size (self, icon_size);
}
}
NULL,
GTK_PARAM_READWRITE));
+ /**
+ * GtkImage:icon-set:
+ *
+ * Deprecated: 3.10: Use #GtkImage:icon-name instead.
+ */
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_object_class_install_property (gobject_class,
PROP_ICON_SET,
g_param_spec_boxed ("icon-set",
P_("Icon set to display"),
GTK_TYPE_ICON_SET,
GTK_PARAM_READWRITE));
-
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
g_object_class_install_property (gobject_class,
PROP_ICON_SIZE,
g_param_spec_int ("icon-size",
G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_SET:
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_set_from_icon_set (image, g_value_get_boxed (value),
icon_size);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
break;
case PROP_ICON_SIZE:
_gtk_icon_helper_set_icon_size (priv->icon_helper, g_value_get_int (value));
g_value_set_string (value, _gtk_icon_helper_get_stock_id (priv->icon_helper));
break;
case PROP_ICON_SET:
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
g_value_set_boxed (value, _gtk_icon_helper_peek_icon_set (priv->icon_helper));
- break;
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ break;
case PROP_ICON_SIZE:
g_value_set_int (value, _gtk_icon_helper_get_icon_size (priv->icon_helper));
break;
*
* Note that this function just creates an #GtkImage from the pixbuf. The
* #GtkImage created will not react to state changes. Should you want that,
- * you should use gtk_image_new_from_icon_set().
+ * you should use gtk_image_new_from_icon_name().
*
* Return value: a new #GtkImage
**/
* #GtkImage will add its own reference rather than adopting yours.
*
* Return value: a new #GtkImage
+ *
+ * Deprecated: 3.10: Use gtk_image_new_from_icon_name() instead.
**/
GtkWidget*
gtk_image_new_from_icon_set (GtkIconSet *icon_set,
image = g_object_new (GTK_TYPE_IMAGE, NULL);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
gtk_image_set_from_icon_set (image, icon_set, size);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
return GTK_WIDGET (image);
}
* @size: (type int): a stock icon size
*
* See gtk_image_new_from_icon_set() for details.
+ *
+ * Deprecated: 3.10: Use gtk_image_set_from_icon_name() instead.
**/
void
gtk_image_set_from_icon_set (GtkImage *image,
g_object_freeze_notify (G_OBJECT (image));
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
if (icon_set)
gtk_icon_set_ref (icon_set);
_gtk_icon_helper_set_icon_set (priv->icon_helper, icon_set, size);
gtk_icon_set_unref (icon_set);
}
-
+
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
g_object_notify (G_OBJECT (image), "icon-set");
g_object_notify (G_OBJECT (image), "icon-size");
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_new_from_icon_name)
GtkWidget* gtk_image_new_from_stock (const gchar *stock_id,
GtkIconSize size);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10_FOR(gtk_image_new_from_icon_name)
GtkWidget* gtk_image_new_from_icon_set (GtkIconSet *icon_set,
GtkIconSize size);
GDK_AVAILABLE_IN_ALL
void gtk_image_set_from_stock (GtkImage *image,
const gchar *stock_id,
GtkIconSize size);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_10_FOR(gtk_image_set_from_icon_name)
void gtk_image_set_from_icon_set (GtkImage *image,
GtkIconSet *icon_set,
GtkIconSize size);
image = gtk_image_menu_item_get_image (image_menu_item);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
if (GTK_IS_IMAGE (image) &&
stock_id && gtk_icon_factory_lookup_default (stock_id))
{
return TRUE;
}
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
return FALSE;
}
{
GtkWidget *image;
GIcon *icon = gtk_action_get_gicon (action);
- const gchar *stock_id = gtk_action_get_stock_id (action);
+ const gchar *stock_id;
+ gboolean ret = FALSE;
+
+ stock_id = gtk_action_get_stock_id (action);
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
image = gtk_image_menu_item_get_image (image_menu_item);
!(stock_id && gtk_icon_factory_lookup_default (stock_id)))
{
gtk_image_set_from_gicon (GTK_IMAGE (image), icon, GTK_ICON_SIZE_MENU);
- return TRUE;
+ ret = TRUE;
}
- return FALSE;
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ return ret;
}
static void
static void
change_icon_theme (GtkPathBar *path_bar)
{
- GtkSettings *settings;
gint width, height;
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (path_bar)));
-
- if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height))
+ if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
path_bar->priv->icon_size = MAX (width, height);
else
path_bar->priv->icon_size = FALLBACK_ICON_SIZE;
static gint
get_icon_size (GtkPlacesSidebar *sidebar)
{
- GtkSettings *settings;
gint width, height;
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (sidebar)));
-
- if (gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &width, &height))
+ if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
return MAX (width, height);
else
return 16;
cairo_t *cr,
GtkPrintUnixDialog *dialog)
{
- GtkSettings *settings;
gint size;
gfloat scale;
gboolean collate, reverse, rtl;
rtl = (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL);
- settings = gtk_widget_get_settings (widget);
- gtk_icon_size_lookup_for_settings (settings,
- GTK_ICON_SIZE_DIALOG,
- &size,
- NULL);
+ gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
scale = size / 48.0;
text_x = rtl ? 4 : 11;
{
GtkPrintUnixDialog *dialog = (GtkPrintUnixDialog *)widget;
GtkPrintUnixDialogPrivate *priv = dialog->priv;
- GtkSettings *settings;
gint size;
gfloat scale;
- settings = gtk_widget_get_settings (widget);
- gtk_icon_size_lookup_for_settings (settings,
- GTK_ICON_SIZE_DIALOG,
- &size,
- NULL);
+ gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, NULL);
scale = size / 48.0;
gtk_widget_set_size_request (priv->collate_image,
get_icon_size_for_widget (GtkWidget *widget,
GtkIconSize icon_size)
{
- GtkSettings *settings;
gint width, height;
- if (gtk_widget_has_screen (widget))
- settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
- else
- settings = gtk_settings_get_default ();
-
- if (gtk_icon_size_lookup_for_settings (settings, icon_size,
- &width, &height))
+ if (gtk_icon_size_lookup (icon_size, &width, &height))
return MAX (width, height);
return FALLBACK_ICON_SIZE;
round_pixel_size (GtkWidget *widget,
gint pixel_size)
{
- GdkScreen *screen;
- GtkSettings *settings;
GtkIconSize s;
gint w, h, d, dist, size;
- screen = gtk_widget_get_screen (widget);
-
- if (!screen)
- return GTK_ICON_SIZE_MENU;
-
- settings = gtk_settings_get_for_screen (screen);
-
dist = G_MAXINT;
size = 0;
for (s = GTK_ICON_SIZE_MENU; s <= GTK_ICON_SIZE_DIALOG; s++)
{
- if (gtk_icon_size_lookup_for_settings (settings, s, &w, &h))
+ if (gtk_icon_size_lookup (s, &w, &h))
{
d = MAX (abs (pixel_size - w), abs (pixel_size - h));
if (d < dist)
* %NULL.
*
* Returns: (transfer none): The looked up %GtkIconSet, or %NULL
+ *
+ * Deprecated: 3.10: Use gtk_icon_theme_lookup_icon() instead.
**/
GtkIconSet *
gtk_style_context_lookup_icon_set (GtkStyleContext *context,
const gchar *stock_id)
{
GtkStyleContextPrivate *priv;
+ GtkIconSet *icon_set;
g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL);
g_return_val_if_fail (stock_id != NULL, NULL);
priv = context->priv;
g_return_val_if_fail (priv->widget != NULL || priv->widget_path != NULL, NULL);
- return gtk_icon_factory_lookup_default (stock_id);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
+ icon_set = gtk_icon_factory_lookup_default (stock_id);
+
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
+ return icon_set;
}
/**
* Returns: (transfer full): a newly-created #GdkPixbuf containing the rendered icon
*
* Since: 3.0
+ *
+ * Deprecated: 3.10: Use gtk_icon_theme_load_icon() instead.
**/
GdkPixbuf *
gtk_render_icon_pixbuf (GtkStyleContext *context,
gint *width,
gint *height)
{
- GdkScreen *screen;
- GtkSettings *settings;
-
- screen = gtk_theming_engine_get_screen (engine);
- settings = gtk_settings_get_for_screen (screen);
-
- return gtk_icon_size_lookup_for_settings (settings, size, width, height);
+ return gtk_icon_size_lookup (size, width, height);
}
static void
gint height = 1;
cairo_t *cr;
cairo_surface_t *surface;
+ gboolean wildcarded;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
base_pixbuf = gtk_icon_source_get_pixbuf (source);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+
state = gtk_theming_engine_get_state (engine);
g_return_val_if_fail (base_pixbuf != NULL, NULL);
/* If the size was wildcarded, and we're allowed to scale, then scale; otherwise,
* leave it alone.
*/
- if (size != (GtkIconSize) -1 &&
- gtk_icon_source_get_size_wildcarded (source))
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ wildcarded = gtk_icon_source_get_size_wildcarded (source);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ if (size != (GtkIconSize) -1 && wildcarded)
scaled = scale_or_ref (base_pixbuf, width, height);
else
scaled = g_object_ref (base_pixbuf);
/* If the state was wildcarded, then generate a state. */
- if (gtk_icon_source_get_state_wildcarded (source))
+ if (wildcarded)
{
if (state & GTK_STATE_FLAG_INSENSITIVE)
{
icon_size = gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (button));
if (need_icon)
{
+ GtkIconSet *icon_set = NULL;
+
+ if (button->priv->stock_id)
+ {
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ icon_set = gtk_icon_factory_lookup_default (button->priv->stock_id);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ }
+
if (button->priv->icon_widget)
{
icon = button->priv->icon_widget;
NULL);
}
}
- else if (button->priv->stock_id &&
- gtk_icon_factory_lookup_default (button->priv->stock_id))
+ else if (icon_set != NULL)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
icon = gtk_image_new_from_stock (button->priv->stock_id, icon_size);
}
static GtkWidget *
-clone_image_menu_size (GtkImage *image, GtkSettings *settings)
+clone_image_menu_size (GtkImage *image)
{
GtkImageType storage_type = gtk_image_get_storage_type (image);
}
else if (storage_type == GTK_IMAGE_ICON_SET)
{
+ GtkWidget *widget;
GtkIconSet *icon_set;
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gtk_image_get_icon_set (image, &icon_set, NULL);
- return gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU);
+ widget = gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ return widget;
}
else if (storage_type == GTK_IMAGE_GICON)
{
{
gint width, height;
- if (settings &&
- gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
- &width, &height))
+ if (gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height))
{
GdkPixbuf *src_pixbuf, *dest_pixbuf;
GtkWidget *cloned_image;
if (GTK_IS_IMAGE (button->priv->icon_widget))
{
- menu_image = clone_image_menu_size (GTK_IMAGE (button->priv->icon_widget),
- gtk_widget_get_settings (GTK_WIDGET (button)));
+ menu_image = clone_image_menu_size (GTK_IMAGE (button->priv->icon_widget));
}
else if (button->priv->stock_id)
{
const gchar *stock_id = gtk_action_get_stock_id (action);
GIcon *icon = gtk_action_get_gicon (action);
GtkIconSize icon_size = GTK_ICON_SIZE_BUTTON;
+ GtkIconSet *icon_set = NULL;
- if ((stock_id && gtk_icon_factory_lookup_default (stock_id)) || !icon)
+ if (stock_id)
+ {
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ icon_set = gtk_icon_factory_lookup_default (stock_id);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ }
+
+ if (icon_set != NULL || !icon)
image = NULL;
else
{
GtkToolButton *button;
GIcon *icon;
const gchar *stock_id;
+ GtkIconSet *icon_set = NULL;
parent_activatable_iface->sync_action_properties (activatable, action);
G_GNUC_END_IGNORE_DEPRECATIONS;
gtk_tool_button_set_icon_name (button, gtk_action_get_icon_name (action));
- if (stock_id && gtk_icon_factory_lookup_default (stock_id))
+ if (stock_id)
+ {
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+ icon_set = gtk_icon_factory_lookup_default (stock_id);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
+ }
+
+ if (icon_set != NULL)
gtk_tool_button_set_icon_widget (button, NULL);
else if ((icon = gtk_action_get_gicon (action)) != NULL)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
image = gtk_image_new_from_stock (GTK_STOCK_REDO, GTK_ICON_SIZE_DIALOG);
gtk_grid_attach (GTK_GRID (grid), image, 1, 2, 1, 1);
- G_GNUC_END_IGNORE_DEPRECATIONS;
label = gtk_label_new ("GTK_IMAGE_ICON_SET");
gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
gtk_icon_set_add_source (iconset, iconsource);
image = gtk_image_new_from_icon_set (iconset, GTK_ICON_SIZE_DIALOG);
gtk_grid_attach (GTK_GRID (grid), image, 1, 3, 1, 1);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
label = gtk_label_new ("GTK_IMAGE_ICON_NAME");
gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
GtkIconSet *icon_set;
GtkIconSource *icon_source;
GtkWidget *image;
-
+
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
+
builder = builder_new_from_string (buffer1, -1, NULL);
factory = gtk_builder_get_object (builder, "iconfactory1");
g_assert (factory != NULL);
GTK_BUILDER_ERROR_INVALID_ATTRIBUTE));
g_error_free (error);
#endif
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
}